package edu.noteBook.service.impl;

import edu.noteBook.Pojo.Note;
import edu.noteBook.dao.NoteDao;
import edu.noteBook.service.NoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoteServiceImpl implements NoteService {

    @Autowired
    private NoteDao noteDao;
    @Override
    public boolean addNote(Note note) {
        return noteDao.addNote(note);
    }

    @Override
    public boolean deleteNote(Integer id) {
        return noteDao.deleteNote(id);
    }

    @Override
    public boolean updateNote(Note note) {
        return noteDao.updateNote(note);
    }

    @Override
    public Note queryNoteById(Integer id) {
        return noteDao.queryNoteById(id);
    }

    @Override
    public List<Note> queryNoteByTitle(String title) {
        return noteDao.queryNoteByTitle(title);
    }

    @Override
    public List<Note> queryAllNote(Integer offset , Integer limit) {
        return noteDao.queryAllNote(offset ,limit);
    }

    @Override
    public List<Note> queryNoteByType(Integer type) {
        return noteDao.queryNoteByType(type);
    }

    @Override
    public List<Note> queryAllNote1(Integer offset , Integer limit, Integer username) {
        return noteDao.queryAllNote1(offset ,limit,username);
    }
}
